One of the common problems that arises in recreational math is to find the circle which is described by three random points which are not on the same line. Clearly, the three points have to be distinct, since two points can form infinitely many circles. The rectangular coordinate equation of a circle is $$(x-h)^{2}+(y-k)^{2}=r^{2} \tag{1} \label{1}$$ where $(h,k)$ represent the center, $r$ is the radius and $(x,y)$ are the points on the circle. A simple brute force method to solving the problem is to write three equations for the three given points and solve for $h$, $k$, and $r$. Using a CAS (computer algebra machine) code to do this is given in Listing 1.
var('r h k')
x1=1;y1=1 #1st point on circle
x2=3;y2=-7 #2nd point on circle
x3=12;y3=1 #3rd point on circle
EQ1=(x1-h)^2+(y1-k)^2==r^2 #1st Equation of circle
EQ2=(x2-h)^2+(y2-k)^2==r^2 #2nd Equation of circle
EQ3=(x3-h)^2+(y3-k)^2==r^2 #3rd Equation of circle
pc=solve([EQ1,EQ2,EQ3],h,k,r,solution_dict=True) #Ask SAGE to solve equations
r= pc[1][r].n(30) #save answers from SAGE
h=pc[0][h].n(30) #save answers from SAGE
k=pc[0][k].n(30;) print r,h,k #ask SAGE to print answers
RESULT: h=6.5; k=-1.875; r=6.2061 #Center point and radius returned by SAGE
Find a circle from 3 points: Code to let SAGE find the circle made from 3 points. There is no math here, just some technical knowledge about how to use an algebra machine. Notice for instance, the line that begins as "pc=solve".
There is another way. If the simultaneous solution above is replaced with some clever substitutions, it is fairly easy to get the solution by hand.
Let the three points be $(x_{1},\,y_{1})\quad(x_{2},\,y_{2})\quad(x_{3},\,y_{3})$ then define $n_1, n_2$ and $p_1, p_2$. Then use these to calculate $h,k$ and $r$. $$n_{1}=\frac{y_{1}-y_{2}}{x_{1}-x_{2}}\qquad n_{2}=\frac{y_{1}-y_{3}}{x_{1}-x_{3}}$$ $$p_{1}=\frac{x_{1}+x_{3}}{2}+n_{1}\left(\frac{y_{1}+y_{2}}{2}\right)\qquad p_{2}=\frac{x_{1}+x_{3}}{2}+n_{2}\left(\frac{y_{1}+y_{3}}{2}\right)$$ $$k=\frac{p_{2}-p_{1}}{n_{2}-n_{1}}$$ $$h=p_{2}-n_{2}k$$ $$r=\sqrt{(x_{1}-h)^{2}+(y_{1}-k)^{2}}$$
The following method is useful in two dimensions as presented here, but it is probably the easiest way to find the circle when the points are in 3-space. The 3-space method is presented later in a chapter about vectors as it has a few more twists to get the circle equation.
If we draw any triangle, and then construct perpendicular lines at the mid-point of each side, the three lines will meet at a single point. This phenomenon is known as “concurrency”. As it turns out, the concurrent point represents the center of a circle that passes through each of the three triangle vertices and has radius of distance $\Vert(center-vertex)\Vert$. Thus having quickly identified both the circles center, $C$ and radius,$r$, its equations is $(x-C_x)^2 + (y-C_y)^2=r^2.$
Answer: The line from $P$ to $Q$ has midpoint $P'=(Q+P)/2=(2.5,3)$. The direction vector $(Q-P)=\binom{3}{4}$, which means the slope is $\frac{4}{3}$ and the perpendicular slope $(-1/m)$ is $\frac{-3}{4}$. Using the point $P'$, we can solve for the perpendicular line to get $y=-\frac{3}{4}x+4.875$.
The line from $R$ to $Q$ has midpoint $Q'=(R+Q)/2=(4.5,3)$. The direction vector $(Q-R)=\binom{-1}{4}$, which means the slope is $-4$ and the perpendicular slope $(-1/m)$ is $\frac{1}{4}$. Using the point $Q'$ , we can solve for the perpendicular line to get $y=\frac{1}{4}x+1.875$.
Now we can solve for the intersection of the two lines: $y=-\frac{3}{4}x+4.875$ and $y=\frac{1}{4}x+1.875$, which will give $\binom{x}{y}=\binom{3}{2.625}$, which is the center point for a circle that will pass through the 3 points. The radius is given by $$\left\Vert\binom{3}{2.625}-\binom{1}{1}\right\Vert=$$ $$\sqrt{(3-1)^2+(2.625-1)^2}=2.57694.$$
Now we can write the circle equation: $(x-3)^{2}+(y-2.625)^{2}=2.57694^{2}$.